package com.cql.controller;

import com.cql.pojo.User;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@CrossOrigin
@RequestMapping("/attachmeController")
public class AttachmeController {

    @RequestMapping(value = "/multifileUpload", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String upload(@RequestPart("file")MultipartFile file, @RequestParam("name") String name) {
        System.out.println(file.getOriginalFilename() + "~~" + name);
        return file.getOriginalFilename();
    }
}
